home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1689 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.3 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Mon, 11 Jul 94 10:36:14 +0200
  3. Message-Id: <9407110836.AA25298@issan.informatik.uni-dortmund.de>
  4. To: Stephen.Usher@earth.ox.ac.uk
  5. In-Reply-To: <21204.9407110710@earth.ox.ac.uk> (message from Stephen Usher on Mon, 11 Jul 1994 08:10:13 +0100 (BST))
  6. Subject: Re: MiNTlib (I think I'm on pl43): Bug in sprintf().
  7.  
  8. Stephen Usher <Stephen.Usher@earth.ox.ac.uk> writes:
  9.  
  10. |> When a statement such as the following is run sprintf terminates after the
  11. |> first argument:-
  12.  
  13. |>     sprintf((char *)temp, "%c%c%c%c%s%c%c", IAC, SB, TELOPT_TERMTYPE,
  14. |>         TELOPT_QUAL, term, IAC, SB);
  15.  
  16. |>     where IAC, SB, TELOPT* are all non-ACSII characters with the top bit
  17. |>     set, ie. 127 < x < 256. The first two are actually (from memory)
  18. |>     0xff and 0xfa.
  19.  
  20. |> All you get in temp is the first byte, ie. 0xff. printf() works correctly.
  21.  
  22. Here is a patch:
  23.  
  24. --- sprintf.c~    Tue Oct 12 08:19:02 1993
  25. +++ sprintf.c    Mon Jul 11 10:31:28 1994
  26. @@ -12,7 +12,7 @@ sputc (ch, fp)
  27.  {
  28.    char **bufp = (char **) fp;
  29.    *(*bufp)++ = ch;
  30. -  return ch;
  31. +  return ch & 0xff;
  32.  }
  33.  
  34.  #ifdef __STDC__
  35.  
  36. -- 
  37. +------------------------------------------------------------------------+
  38. Andreas Schwab                                      "And now for something
  39. schwab@ls5.informatik.uni-dortmund.de                completely different"
  40.